﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;
using System.Xml.Linq;
using System.Xml.XPath;
using System.IO;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Media.Animation;

namespace MyDesktopMicroBlog
{
    /// <summary>
    /// Interaction logic for _1.xaml
    /// </summary>
    public partial class _1 : Window
    {
        Storyboard myStoryBoard = new Storyboard();
        public _1()
        {
            InitializeComponent();
            DoubleAnimation doubleAnimation = new DoubleAnimation();
            doubleAnimation.From = 1;
            doubleAnimation.To = 0;
            doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(3));
            Storyboard.SetTargetName(doubleAnimation, tbStatusBlock.Name);
            Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath(TextBlock.OpacityProperty));
            myStoryBoard.Children.Add(doubleAnimation);
        }

        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            myStoryBoard.Begin(tbStatusBlock);
        }
    }
}
